package a.f.d;

import a.a.kb;
import a.c.bb;
import a.c.e;
import a.c.k;
import a.c.w;
import a.f.n.hb;
import a.f.o;

import java.awt.geom.Rectangle2D;

public class l
  extends f
{
  private u p = new h();
  public static int q;
  
  public void b(double paramDouble)
  {
    super.b(paramDouble);
    this.p.b(paramDouble);
  }
  
  public void c(double paramDouble)
  {
    super.c(paramDouble);
    this.p.c(paramDouble);
  }
  
  public void a(double paramDouble)
  {
    this.f = paramDouble;
    this.p.a(paramDouble);
  }
  
  public void d(double paramDouble)
  {
    this.g = paramDouble;
    this.p.d(paramDouble);
  }
  
  public void a(u paramu)
  {
    this.p = paramu;
  }
  
  protected void a(bb[] paramArrayOfbb, k paramk)
  {
    int m = f.o;
    int k = f.n;
    o localo = this.l;
    if (((m != 0) || (this.p != null)) && ((m != 0) || (this.j != null))) {
      this.p.a(this.j);
    }
    if (paramArrayOfbb[0].size() != 1)
    {
      n.a(this, "Treedrawer: Not a tree !");
      this.p.a(localo, paramArrayOfbb, paramk);
      return;
    }
    w localw = localo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      if ((m == 0) && (k != 0)) {
        break label164;
      }
      if (localw.d().d() > 1)
      {
        n.a(this, "Treedrawer: Not a tree !");
        this.p.a(localo, paramArrayOfbb, paramk);
        return;
      }
      localw.f();
    } while (k == 0);
    if ((m != 0) || (!this.l.n())) {
      label164:
      if (m != 0) {}
    }
    int i = kb.e(localo) ? 1 : 0;
    if (m == 0)
    {
      if (i == 0)
      {
        n.a(this, "Treedrawer: Not a valid tree !");
        this.p.a(localo, paramArrayOfbb, paramk);
        return;
      }
      n.a(this, "Treedrawer: It's a tree !");
    }
    w[] arrayOfw = new w[paramArrayOfbb.length];
    int j = 0;
    if (j < paramArrayOfbb.length)
    {
      arrayOfw[j] = paramArrayOfbb[j].l();
      j++;
    }
    for (;;)
    {
      if ((m != 0) || (k == 0))
      {
        if (k == 0) {
          break;
        }
        if (m == 0) {
          a(localo, arrayOfw);
        }
      }
    }
    a.f.n.d locald = new a.f.n.d();
    locald.a(new b_(c()));
    hb local0 = new hb()
    {
      public void a(o paramAnonymouso, e paramAnonymouse) {}
    };
    locald.a(local0);
    locald.q();
    locald.doLayout(localo);
  }
  
  public static class b_
    extends a.f.n.h
  {
    private final double k;
    public static boolean l;
    
    public b_(double paramDouble)
    {
      this.k = paramDouble;
    }
    
    protected byte c(e parame)
    {
      return -2;
    }
    
    protected d.a_ a(e parame, byte paramByte)
    {
      int i1 = f.o;
      int n = f.n;
      d.a_ locala_1;
      if (parame.e() == 0)
      {
        locala_1 = b(parame);
        if (n == 0) {}
      }
      else
      {
        Object localObject = null;
        locala_1 = b(parame);
        Rectangle2D localRectangle2D = locala_1.b();
        double d1 = 1.7976931348623157E+308D;
        double d2 = -1.797693134862316E+308D;
        a.d.f localf = null;
        double d3 = 0.0D;
        int i = 0;
        a.c.d locald = parame.h();
        if (locald != null) {}
        label201:
        label232:
        label238:
        while (i1 != 0)
        {
          d.a_ locala_2 = a(locald.f());
          if (i1 != 0) {
            break label425;
          }
          locala_2.a(locala_2.c(), locala_2.d(), locala_2.c(), 0.0D);
          if (n != 0) {
            break label422;
          }
          if (i1 == 0)
          {
            if (localf == null)
            {
              localf = locala_2.a(1);
              if (i1 != 0) {
                break label201;
              }
              if (n == 0) {}
            }
            else
            {
              locala_2.b(-localf.f(locala_2.a(3)) + this.k, 0.0D);
            }
          }
          else {
            localf.d(locala_2.a(1));
          }
          d1 = Math.min(d1, locala_2.c());
          d2 = Math.max(d2, locala_2.c());
          if (i1 == 0) {
            if (localObject == null)
            {
              localObject = locala_2;
              if (i1 != 0) {
                break label238;
              }
              if (n == 0) {
                break label232;
              }
            }
          }
          localObject.a(locala_2);
          if (i1 == 0) {}
          int j = parame.e() % 2 == 0 ? 1 : 0;
          if (i1 == 0) {}
          int m = parame.e() % 2 == 1 ? (parame.e() - 1) / 2 : parame.e() / 2 - 1;
          if (i1 == 0) {
            if (j != 0)
            {
              if (i1 == 0)
              {
                if (i == m)
                {
                  d3 = locala_2.c();
                  if (i1 != 0) {
                    break label401;
                  }
                  if (n == 0) {
                    break label389;
                  }
                }
                if (i1 != 0) {
                  break label401;
                }
              }
              if (i != m + 1) {
                break label389;
              }
              d3 += locala_2.c();
              d3 *= 0.5D;
              if (i1 != 0) {
                break label401;
              }
              if (n == 0) {
                break label389;
              }
            }
          }
          if (i1 == 0)
          {
            if (i == m) {
              d3 = locala_2.c();
            }
            locald = locald.i();
            i++;
          }
          if (n == 0) {
            break;
          }
        }
        label389:
        label401:
        locala_1.b(d3 - localRectangle2D.getCenterX(), 0.0D);
        label422:
        label425:
        locala_1.a(localObject);
      }
      return locala_1;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.l

 * JD-Core Version:    0.7.0.1

 */